package com.tanger.permission.permission.service.impl;

import com.tanger.common.result.ActionResult;
import com.tanger.common.utils.RecursiveUtils;
import com.tanger.permission.mapper.permission.PermissionMapper;
import com.tanger.permission.permission.service.PermissionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Description 权限实现类
 * @Author Hchenbin
 * @Date 2022/6/28 15:01
 * @Version 1.0
 */
@Service
public class PermissionServiceImpl implements PermissionService{

    @Autowired
    private PermissionMapper permissionMapper;
    private static Logger logger = LoggerFactory.getLogger(PermissionServiceImpl.class);

    @Override
    public ActionResult permissionInfo(Long id,String code) {
        return ActionResult.buildResultSuccess(permissionMapper.PermissionInfo(id,code));
    }

    @Override
    public ActionResult queryPermissionList(Map<String, Object> params) {
        return ActionResult.buildResultSuccess(RecursiveUtils.queryRecursiveList(permissionMapper.queryPermission(params),"other"));
    }
}
